home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1997-01-29 | 4.6 KB | 176 lines |
- 10 'RADANGLE - Antenna radiation angle vs. height - 09 OCT 95 rev. 27 SEP 96
- 20 IF EX$=""THEN EX$="EXIT"
- 30 CLS:KEY OFF
- 40 COLOR 7,0,1
- 50 DIM A(20)
- 60 PI=3.14159
- 70 V=2.99793E+06*10^-4 'speed of light
- 80 UL$=STRING$(80,205)
- 90 U1$="###.###"
- 100 N=0 'reset counter
- 110 '
- 120 '.....start
- 130 CLS
- 140 COLOR 15,2
- 150 PRINT " RADIATION ANGLE - ANTENNAS";TAB(57);"by George Murphy VE3ERP ";
- 160 COLOR 1,0:PRINT STRING$(80,223);
- 170 COLOR 7,0
- 180 '
- 190 '.....standard antenna disclaimer
- 200 OPEN"I",1,"\data\docfiles\antenna.doc
- 210 IF EOF(1)THEN 230
- 220 INPUT#1,Z$:PRINT " ";Z$:GOTO 210
- 230 CLOSE
- 240 PRINT UL$;
- 250 GOSUB 1250 'preface
- 260 Z$=INKEY$:IF Z$=""THEN 260
- 270 IF Z$="0"THEN CLS:RUN EX$
- 280 IF Z$="1"THEN 300
- 290 GOTO 260
- 300 VIEW PRINT CSRLIN-1 TO 24:CLS:VIEW PRINT
- 310 GOSUB 1630 'dump screen
- 320 VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
- 330 GOTO 400
- 340 '
- 350 '.....format input line
- 360 LOCATE CSRLIN-1:PRINT SPC(7);
- 370 LOCATE CSRLIN,47:PRINT STRING$(7,".");USING U1$;ZZ;
- 380 RETURN
- 390 '
- 400 '.....input data
- 410 PRINT " Press number in < > to enter antenna height in:
- 420 PRINT UL$;
- 430 PRINT " <1> Wavelengths"
- 440 PRINT " <2> Metres"
- 450 PRINT " <3> Feet"
- 460 I$=INKEY$:IF I$=""THEN 460
- 470 IF I$="1"THEN L=1:GOTO 500
- 480 IF VAL(I$)>=1 AND VAL(I$)<=3 THEN 500
- 490 GOTO 460
- 500 VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
- 510 INPUT " ENTER: Resonant frequency of antenna...........(MHz)";F
- 520 ZZ=F:GOSUB 350:PRINT " MHz"
- 530 W=V/F
- 540 PRINT " Wavelength...................................";USING U1$;W;
- 550 PRINT " metres"
- 560 '
- 570 IF I$="1"THEN H$="wavelengths"
- 580 IF I$="2"THEN H$="metres....."
- 590 IF I$="3"THEN H$="feet......."
- 600 PRINT " ENTER: Height of antenna in ";H$;".............";:INPUT HT
- 610 ZZ=HT:GOSUB 350:PRINT " "
- 620 IF I$="1"THEN H=HT
- 630 IF I$="2"THEN H=HT/W
- 640 IF I$="3"THEN H=HT/W*0.3048
- 650 IF H=HT THEN 670
- 660 PRINT " Height of antenna in wavelengths.............";USING U1$;H
- 670 IF H>=0.25 AND H<=5 THEN 900
- 680 BEEP:PRINT
- 690 IF H>=0.25 THEN 820
- 700 M=HT/H/4
- 710 IF I$="1"THEN M$="":PRINT
- 720 IF I$="2"THEN M$=" metres."
- 730 IF I$="3"THEN M$=" feet."
- 740 PRINT TAB(6);"1/4 wavelength =";USING U1$;M;:PRINT M$
- 750 PRINT
- 760 PRINT TAB(6);
- 770 PRINT "Antenna heights less than 1/4 wavelength cannot attain maximum"
- 780 PRINT TAB(6);
- 790 PRINT "ground reflection reinforcement to the direct ray from the antenna."
- 800 GOTO 870
- 810 '
- 820 PRINT:PRINT TAB(6);
- 830 PRINT "You have entered a height of more than five wavelengths, which is";
- 840 PRINT TAB(6);
- 850 PRINT "the arbitrary practical limit set by this program."
- 860 GOTO 870
- 870 PRINT:PRINT TAB(6);"Press any key to start over..........."
- 880 IF INKEY$=""THEN 880 ELSE CLS:GOTO 140
- 890 '
- 900 '.....compute results
- 910 IF H/0.25=INT(H/0.25)THEN H=H+9.8E-08
- 920 N=N+1
- 930 X=N/4/H
- 940 GOSUB 1180
- 950 IF DELTA=PI/2 THEN 990
- 960 A(N)=D
- 970 GOTO 920
- 980 '
- 990 '.....screen print
- 1000 PRINT UL$;
- 1010 PRINT TAB(7);
- 1020 PRINT "RADIATION ANGLES AT WHICH GROUND-REFLECTION MAXIMA and NULLS APPEAR"
- 1030 PRINT TAB(27);"MAXIMA";TAB(46);"NULLS"
- 1040 PRINT UL$;
- 1050 FOR Z=1 TO N STEP 2
- 1060 IF A(Z)<>0 THEN PRINT TAB(28);USING "##.#";A(Z);:PRINT "<UNK! {00F8}>";
- 1070 IF A(Z+1)<>0 THEN PRINT TAB(46);USING "##.#";A(Z+1);:PRINT "<UNK! {00F8}>";
- 1080 NEXT Z
- 1090 PRINT UL$;
- 1100 PRINT TAB(T);
- 1110 PRINT "Appreciable HF radiation at angles smaller than a few degrees is"
- 1120 PRINT TAB(T);
- 1130 PRINT "almost impossible to obtain over horizontal ground. However, above"
- 1140 PRINT TAB(T);
- 1150 PRINT "15<UNK! {00F8}> the above angles are accurate enough for practical purposes."
- 1160 GOTO 1580 'end
- 1170 '
- 1180 '.....compute arcsin of angle X
- 1190 Y=-X^2+1
- 1200 IF Y<=0 THEN DELTA=PI/2:GOTO 1220
- 1210 DELTA=ATN(X/SQR(Y)) 'wave angle in radians
- 1220 D=DELTA*180/PI 'wave angle in degrees
- 1230 RETURN
- 1240 '
- 1250 '.....preface
- 1260 T=7
- 1270 PRINT TAB(T);
- 1280 PRINT " This program computes the antenna wave angle versus height above"
- 1290 PRINT TAB(T);
- 1300 PRINT "the effective ground plane, which is seldom the actual surface of"
- 1310 PRINT TAB(T);
- 1320 PRINT "the ground. Instead, it is usually a few centimetres to perhaps a"
- 1330 PRINT TAB(T);
- 1340 PRINT "metre or so below it, depending on the characteristics of the soil."
- 1350 PRINT
- 1360 PRINT TAB(T);
- 1370 PRINT " The calculations are valid for all horizontal antennas and for"
- 1380 PRINT TAB(T);
- 1390 PRINT "vertical antennas having a length equal to an even multiple of"
- 1400 PRINT TAB(T);
- 1410 PRINT "one-half wavelength. For vertical antennas an odd number of half-"
- 1420 PRINT TAB(T);
- 1430 PRINT "waves long, the maxima are the angles shown in the 'NULLS' column"
- 1440 PRINT TAB(T);
- 1450 PRINT "and the nulls are the angles shown in the 'MAXIMA' column."
- 1460 PRINT
- 1470 PRINT TAB(T);
- 1480 PRINT " The program is based on data presented in the ARRL ELECTRONICS"
- 1490 PRINT TAB(T);
- 1500 PRINT "DATA BOOK, Second Edition, page 7-1, and the 1994 ARRL HANDBOOK,"
- 1510 PRINT TAB(T);
- 1520 PRINT "pages 17-2 and 17-3."
- 1530 COLOR 0,7:LOCATE 25,22
- 1540 PRINT " Press 1 to continue or 0 to EXIT.....";
- 1550 COLOR 7,0
- 1560 RETURN
- 1570 '
- 1580 '.....end
- 1590 GOSUB 1630
- 1600 GOTO 120
- 1610 END
- 1620 '
- 1630 'HARDCOPY
- 1640 GOSUB 1750:LOCATE 25,2:COLOR 14,6
- 1650 PRINT " Press 1 to print screen, 2 to print screen & ";
- 1660 PRINT "advance paper, or 3 to continue.";:COLOR 7,0
- 1670 Z$=INKEY$:IF Z$="3"THEN GOSUB 1750:RETURN
- 1680 IF Z$="1"OR Z$="2"THEN GOSUB 1750:GOTO 1700
- 1690 GOTO 1670
- 1700 FOR QX=1 TO 24:FOR QY=1 TO 80
- 1710 LPRINT CHR$(SCREEN(QX,QY));
- 1720 NEXT QY:NEXT QX
- 1730 IF Z$="2"THEN LPRINT CHR$(12)
- 1740 GOTO 1640
- 1750 LOCATE 25,1:PRINT STRING$(80,32);:RETURN
-